package com.xjh.basestudy.javabase.streamandlambda;


public class lambda1 {
    public static void main(String[] args) {
        //通过实现类的方式实现需求
        MyRunnable my = new MyRunnable();
        Thread t = new Thread(my);
        t.start();
        //匿名内部类的方式改进
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("多线程启动了");
            }
        }).start();
        //lambda的表达式的方式改进
        new Thread(() -> {
            System.out.println("多线程启动了");
        }).start();
    }
}
